import django_filters
from django.db.models import Q

from .models import Account


class AccountFilter(django_filters.rest_framework.FilterSet):
    username = django_filters.CharFilter(lookup_expr="icontains")
    telephone = django_filters.CharFilter(lookup_expr="icontains")
    realname = django_filters.CharFilter(lookup_expr="icontains")

    class Meta:
        model = Account
        fields = ['username', 'telephone', 'realname', 'is_company']
